<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta
      name="viewport"
      content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
    />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>
  <body>
    <header>
      <input type="checkbox" id="toggler" />

      <label for="toggler">
        <span class="hambuger-container">
          <span></span>
          <span></span>
        </span>
      </label>

      <div class="nav-items">
        <ul>
          <li>Home</li>
          <li>iPhone</li>
          <li>iPad</li>
          <li>Mac</li>
          <li>TV</li>
        </ul>
      </div>
    </header>

    <main>请调试成移动设备查看</main>

    <style>
      main {
        height: calc(100vh - 44px);
        display: flex;
        align-items: center;
        justify-content: center;
      }
      #toggler {
        display: none;
      }

      .hambuger-container {
        display: block;
        width: 20px;
        height: 20px;
        position: relative;
        top: 18px;
      }

      .hambuger-container span {
        display: block;
        height: 1px;
        background-color: #fff;
        position: relative;
        transition:
          transform 0.3s ease-in-out,
          top 0.3s ease-in-out 0.3s;
        top: 0;
      }

      .hambuger-container span:nth-child(2) {
        margin-top: 7px;
      }

      #toggler:checked + label .hambuger-container span:nth-child(1) {
        transform: rotate(45deg);
        top: 4px;
        transition:
          top 0.3s ease-in-out,
          transform 0.3s ease-in-out 0.3s;
      }

      #toggler:checked + label .hambuger-container span:nth-child(2) {
        transform: rotate(-45deg);
        top: -4px;
        transition:
          top 0.3s ease-in-out,
          transform 0.3s ease-in-out 0.3s;
      }

      header {
        height: 44px;
        background-color: #000;
        padding: 0 18px;
      }

      body {
        padding: 0;
        margin: 0;
      }

      .nav-items {
        background-color: rgba(0, 0, 0, 0.82);
        width: 100%;
        height: 100vh;
        position: absolute;
        top: 44px;
        left: 0;
        transform: scaleY(0);
        transition:
          transform 0.3s ease-in-out,
          opacity 0.3s ease-in-out 0.3s;
        transform-origin: 50% 0;
        opacity: 0;
      }

      #toggler:checked ~ .nav-items {
        transform: scaleY(1);
        opacity: 1;
      }

      ul {
        margin-top: 1em;
      }

      ul li {
        color: #fff;
      }
    </style>
  </body>
</html>
